<template>
<div id="app">
    <router-view v-if="isRefresh" />
</div>
</template>
<script>
export default {
    name: 'App',
    // 提供刷新当前页面的方法，可在组件内注入inject:['reload']，掉用this.reload()
    provide () {
        return {
            reload: this.reload
        }
    },
    data () {
        return {
            isRefresh: true
        }
    },
    methods: {
        reload () {
            this.isRefresh = false
            this.$nextTick(() => {
                this.isRefresh = true
            })
        }
    }
}
</script>

<style lang="less">
#app {
    width: 100%;
    height: 100%;
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
}
</style>
